package com.xuelang.pipeline.infrastructure.application.converter;

import com.xuelang.pipeline.domain.application.Component;
import com.xuelang.pipeline.infrastructure.application.dataobject.ComponentDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * 组件实体与组件DO转换器类
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
@Mapper
public interface ComponentToComponentDOConverter {

    ComponentToComponentDOConverter INSTANCE = Mappers.getMapper(ComponentToComponentDOConverter.class);

    /**
     * Component转化为ComponentDO
     * @param component
     * @return
     */
    ComponentDO componentToComponentDO(Component component);

    /**
     * ComponentDO转化为Component
     * @param componentDO
     * @return
     */
    Component componentDOToComponent(ComponentDO componentDO);

}
